﻿using UnityEngine;

namespace HK.Editor.GUIEx.Protocol.Drag
{
    /// <summary>
    /// 委托定义 : Unity对象拖拽
    /// </summary>
    /// <param name="iTarget">拖拽的引用对象列表</param>
    public delegate void ObjectsDragAndDropDown(Object iTarget);
    
    /// <summary>
    /// 委托定义 : Unity对象拖拽
    /// </summary>
    /// <param name="iTarget">拖拽的引用对象列表</param>
    public delegate void ObjectsDragAndDropDown<in TObj>(TObj iTarget) where TObj : UnityEngine.Object;
    
    /// <summary>
    /// 委托定义 : 文件/文件夹拖拽
    /// </summary>
    /// <param name="iAssets">拖拽的资产列表(如:文件/文件夹等)</param>
    public delegate void AssetsDragAndDropDown(string[] iAssets);
    
    /// <summary>
    /// 接口 : 拖拽事件代理
    /// <para>* 可重排序列表(ReorderableList)中拖拽事件的代理</para>
    /// <para>* 用以回传可重排序列表在Inspector视图面板上的拖拽事件</para>
    /// <para>* 拖拽目标分为，Unity内部对象(如GameObject等),文件/问价夹等Unity资产对象等。</para>
    /// </summary>
    public interface IDragAndDropSurrogate
    {
        /// <summary>
        /// 目标类型
        /// </summary>
        System.Type TargetType { get; }
        
        /// <summary>
        /// 扩展类型
        /// </summary>
        bool ExactType { get; }
        
        /// <summary>
        /// 有效标志位
        /// </summary>
        bool Valid { get; }

        /// <summary>
        /// 拖拽
        /// </summary>
        /// <param name="iObjectReference">拖拽的引用对象</param>
        void DragAndDropDown(Object iObjectReference);

        /// <summary>
        /// 拖拽
        /// </summary>
        /// <param name="iAssets">拖拽的资产列表(如:文件/文件夹等)</param>
        void DragAndDropDown(string[] iAssets);
    }
}
